package hw850271.lesson1;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * ͨ������̨����
 *  
 * */

public class PrintInteger01 {

	public static void main(String[] args) {
		BufferedReader brBegin = null;
		BufferedReader brEnd = null;
		BufferedReader brContinue = null;

		try {
			while (true) {
				System.out.println("���뿪ʼ����");
				brBegin = new BufferedReader(new InputStreamReader(System.in));
				String beginStr = brBegin.readLine();
				int begin = Integer.parseInt(beginStr);

				System.out.println("�����������");
				brEnd = new BufferedReader(new InputStreamReader(System.in));
				String endStr = brEnd.readLine();
				int end = Integer.parseInt(endStr);
				
				printInteger(begin, end);
				printInteger(begin, end,47);//ֵ����47ʱ��ֹͣ��ӡ

				System.out.println("�˳�����N or n�������������");
				brContinue = new BufferedReader(new InputStreamReader(System.in));
				String continueStr = brContinue.readLine();
				if (continueStr.toUpperCase().equals("N")) {
					return;
				}
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static void printInteger(int begin, int end) {
		for (int i = begin; i <= end; i++) {
			System.out.println(i);
		}
	}
	
	public static void printInteger(int begin, int end,int exit) {
		for (int i = begin; i <= end; i++) {
			if(i==exit) {
				return;
			}
			System.out.println(i);
		}
	}
}
